package com.tuanzi.loan.business.repository.product.product.impl;

import com.tuanzi.loan.business.entity.product.product.LoanApiFicoTagRecord;
import com.tuanzi.loan.business.repository.product.product.custom.LoanApiFicoTagRecordRepositoryCustom;
import com.tuanzi.loan.core.repository.JOOQBaseRepository;
import org.jooq.impl.TableImpl;

import java.util.List;

import static com.tuanzi.loan.generated.jooq.loan.tables.LoanApiFicoTagRecord.LOAN_API_FICO_TAG_RECORD;

/**
 * @Author: chenweijun
 * @Date: 2019/8/30 11:15
 */
public class LoanApiFicoTagRecordRepositoryImpl extends JOOQBaseRepository implements LoanApiFicoTagRecordRepositoryCustom{

    @Override
    protected TableImpl getTable() {
        return LOAN_API_FICO_TAG_RECORD;
    }


    @Override
    public List<LoanApiFicoTagRecord> findDistinctTags() {

        List<LoanApiFicoTagRecord> loanApiFicoTagRecords =
                dslContext.selectDistinct(LOAN_API_FICO_TAG_RECORD.TAGS).from(LOAN_API_FICO_TAG_RECORD).fetchInto(LoanApiFicoTagRecord.class);
        return loanApiFicoTagRecords;
    }


}
